uint32_t evt_mask;
uint32_t cpu_mask;
unsigned long tbuf_size;
+ int discard:1;
} settings_t;
settings_t opts;
meta = init_bufs_ptrs(tbufs_mapped, num, size);
data = init_rec_ptrs(meta, num);
+ if(opts.discard) {
+ for ( i = 0; (i < num) ; i++ )
+ {
+ meta[i]->cons = meta[i]->prod;
+ }
+ }
+
/* now, scan buffers for events */
while ( !interrupted )
{
}
break;
+ case 'D': /* Discard traces currently in the buffer before beginning */
+ {
+ opts.discard=1;
+ }
+ break;
+
case ARGP_KEY_ARG:
{
if ( state->arg_num == 0 )
"N.B. that the trace buffer cannot be resized. If it has "
"already been set this boot cycle, this argument will be ignored." },
+ { .name = "discard-buffers", .key='D', .arg=NULL,
+ .flags=OPTION_ARG_OPTIONAL,
+ .doc = "Discard all records currently in the trace buffers before "
+ " beginning." },
+
{0}
};